<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">        
    <style>	
	#signupForm {
		width: 670px;
	}
	#signupForm label.error {
		margin-left: 10px;
		width: auto;
		display: inline;
	}
        </style>
    <script src="js//jquery.min.js"></script>
    <script src="js/jquery.validate.min.js"></script>
    <script src="js/messages_zh.min.js"></script>
    <script>        
$(document).ready(function() {
		// validate signup form on keyup and submit
		$("#signupForm").validate({
			rules: {
				username: {
					required: true,
					minlength: 2
				},
				password: {
					required: true,
					minlength: 5
				},
				confirm_password: {
					required: true,
					minlength: 5,
					equalTo: "#password"
				}				
			},
			messages: {				
				username: {
					required: "请输入账号",
					minlength: "至少2个字符"
				},
				password: {
					required: "请输入密码",
					minlength: "密码至少5个字符"
				},
				confirm_password: {
					required: "请输入密码",
					minlength: "密码至少5个字符",
					equalTo: "请与前面密码一致"
				}
			}
    
    });
    
    
    
    
    
})
    
    
    
    </script>
</head>
<body>

<form class="cmxform" id="signupForm" method="post" action="regHander.php">
		<fieldset>
			<legend>用户注册</legend>
			
			<p>
				<label for="username">账号</label>
				<input id="username" name="username" type="text">
			</p>
			<p>
				<label for="password">密码</label>
				<input id="password" name="password" type="password">
			</p>
			<p>
				<label for="confirm_password">重复</label>
				<input id="confirm_password" name="confirm_password" type="password">
			</p>
			
			<p>
				<input class="submit" type="submit" value="注册">
			</p>
		</fieldset>
	</form>
        
        
        
        
        
        
        
        
    </body>
</html>
